import { GetServerSidePropsContext } from 'next'

export const handleRedirect = (ctx: GetServerSidePropsContext, redirect?: string) => {
	let isLogin = false;
	if (isLogin) {
		return false
	} else {
		return {
			destination: `/login?redirect=${redirect || '/my'}`,
			permanent: false,
		}
	}
}